package com.xs.project.controller;

import com.xs.project.common.Result;
import com.xs.project.pojo.vo.ExamListReq;
import com.xs.project.pojo.vo.StudentLeaveClassReq;
import com.xs.project.pojo.vo.resp.ExamTitleStu;
import com.xs.project.pojo.vo.resp.StudentLeaveClassResp;
import com.xs.project.pojo.vo.resp.XsExamResp;
import com.xs.project.service.ExamManagerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/examManager")
@Api(tags = "考试管理")
public class ExamManagerController {

    @Resource
    private ExamManagerService examManagerService;

    @ApiOperation(value = "列表-考试列表", notes = "考试列表")
    @PostMapping(value = "/selectExamList")
    public Result<List<XsExamResp>> selectExamList(@RequestBody ExamListReq request) {
        return examManagerService.selectExamList(request);
    }

    @ApiOperation(value = "新增-考试", notes = "考试列表")
    @PostMapping(value = "/insertExamList")
    public Result<Boolean> insertExamList(@RequestBody XsExamResp request) {
        return examManagerService.insertExamList(request);
    }

    @ApiOperation(value = "更新-考试", notes = "考试列表")
    @PostMapping(value = "/updateExamList")
    public Result<Boolean> updateExamList(@RequestBody XsExamResp request) {
        return examManagerService.updateExamList(request);
    }

    @ApiOperation(value = "删除-考试", notes = "考试列表")
    @PostMapping(value = "/delExamList")
    public Result<Boolean> delExamList(@RequestBody XsExamResp request) {
        return examManagerService.delExamList(request);
    }
    @ApiOperation(value = "阅卷-考试", notes = "题目列表")
    @GetMapping(value = "/selectExamTitleStu")
    public Result<List<ExamTitleStu>> selectExamTitleStu(String teacherId) {
        return examManagerService.selectExamTitleStu(teacherId);
    }

    @ApiOperation(value = "阅卷存储-考试", notes = "题目列表")
    @GetMapping(value = "/saveExamTitleStu")
    public Result<Boolean> saveExamTitleStu(String id,String teacherPoint,String studentId) {
        return examManagerService.saveExamTitleStu(id,teacherPoint,studentId);
    }
    @GetMapping(value = "/pushEmail")
    public Result<Boolean> pushEmail(String examId){
        return examManagerService.pushEmail(examId);
    }

}
